package com.ssm.util;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

/**
 * Created by Lenovo on 2019-10-15.
 */
@Component("zhangsan")
public class Human {
    @Value("张三")
    private String name;
    @Autowired
    @Qualifier("myBmw")
    private Car car;
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public Car getCar() {
        return car;
    }
    public void setCar(Car car) {
        this.car = car;
    }
    public void introduce(){
        System.out.println(getName()+" , car:");
        car.introduce();
    }
}
